{include file="public_head" /}

<!-- datatables -->
<link href="/static/console/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!-- Select2 -->
<link href="/static/console/css/select/select2.min.css" rel="stylesheet">
<!-- chk_3 -->
<link href="/static/console/css/chk_3.css" rel="stylesheet" type="text/css"/>

<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>

                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>个人业绩查询:{$Think.session.name}</h2>

                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="get" action="">
                                    <div class="title_left">
                                        <div class="col-md-4 col-sm-3 col-xs-12 form-group pull-left top_search">
                                        <!--<div class="input-group" style="float: left;margin: 0 20px;">-->

                                        <!--<select name="way" class="select2_single" style="width: 200px;"-->
                                        <!--tabindex="-1">-->
                                        <!--<option value="0">- 请选择支付状态 -</option>-->
                                        <!--<option value="未支付" {eq name=':input("way")' value='未支付' }selected{/eq}>未支付</option>-->
                                        <!--<option value="余额支付" {eq name=':input("way")' value='余额支付' }selected{/eq}>余额支付</option>-->
                                        <!--<option value="支付宝" {eq name=':input("way")' value='支付宝' }selected{/eq}>支付宝</option>-->
                                        <!--<option value="微信" {eq name=':input("way")' value='微信' }selected{/eq}>微信</option>-->
                                        <!--<option value="退款" {eq name=':input("way")' value='退款' }selected{/eq}>退款</option>-->
                                        <!--</select>-->
                                        <!--</div>-->
                                        <div class="input-group" style="float: left;margin: 0 20px;">
                                            <input type="text" class="form-control" name="interval_timer"
                                                   id="interval_timer"
                                                   style="width: 200px;"
                                                   placeholder="请选择时间区间..." value="{:input('interval_timer')}">
                                        </div>
                                        <div class="input-group" style="float: left;margin: 0 20px;">
                                            <input type="text" class="form-control" name="title"

                                                   placeholder="请输入订单号..." value="{:input('title')}">
                                        </div>
                                    </div>
                                    <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索</button>
                            </div>
                            <table style="border-bottom:1px solid #ddd;"
                                   class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr class="success">
                                    <!--<th style="width: 2%; padding: 10px;">-->
                                    <!--<input type="checkbox" class="checkall"-->
                                    <!--onclick="CheckAll(this.checked);"/>-->
                                    <!--</th>-->
                                    <!--<th>排序</th>-->
                                    <th width="">订单ID</th>

                                    <th width="">订单号</th>
                                    <th width="">订单类型</th>
                                    <th width="">服务人员</th>
                                    <th width="">服务金额</th>
                                    <th width="">服务内容</th>
                                    <th width="">服务时间</th>



                                </tr>
                                </thead>
                                <tbody>
                                {empty name="data"}
                                <tr><td colspan="12"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>
                                {/empty}
                                {volist name="data" id="item" key="k"}
                                <tr >
                                    <td>{$item.order_id}</td>
                                    <td>{$item.order_number}</td>
                                    <td>{switch item.order_type}
                                        {case 1}商品订单{/case}
                                        {case 2}服务订单{/case}
                                        {case 3}礼包订单{/case}
                                        {default /}无
                                        {/switch}
                                    </td>

                                    <td>{$item.name}</td>
                                    <td>{$item.assignor_price}</td>
                                    <td>{$item.assignor_content}</td>
                                    <td>{$item.create_time}</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                            <div style="float: right;margin-top: -30px;">{$data->render()}</div>
                            <button type="button" class="btn btn-success" style="margin-top: 20px;" onclick="dc()">订单数：{$order_count}单</button>
                            <button type="button" class="btn btn-danger" style="margin-top: 20px;" onclick="dc()">销售总金额：{$order_sum}元</button>
                            <button type="button" class="btn btn-info" style="margin-top: 20px;" onclick="dc({:input('coupon_id')})">门店人员业绩导出</button>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>
    <!-- /page content -->
</div>

</div>

{include file="public_foot" /}
<!--select-->
<script src="/static/console/js/select/select2.full.min.js"></script>
<!-- daterangepicker -->
<script src="/static/console/js/datepicker/daterangepicker.js"></script>
<!-- public -->
<script src="/static/console/js/public.js"></script>
<!-- layer -->
<script src="/static/console/js/layer.js"></script>
<script type="text/javascript">
    // list
    $(document).ready(function () {
        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".select2_single1").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        // interval_timer
        $('#interval_timer').daterangepicker(null,
            function(start, end, label) {
//                console.log(start.toISOString(), end.toISOString(), label);
            });
    });

    //导出excel表格
    function dc(){
        var assignor_id = {:input('assignor_id',0)};
        var title = "{:input('title')}";
        var both = "{:input('interval_timer')}";
        var both_arr = both.split("/");
        console.log(both);
        if (both_arr[0] == both_arr[1]) {
            layer.msg('请选择时间区间为同1天!');
            return;
        }
        window.location.href = "{:url('daochu')}?assignor_id="+assignor_id+'&title='+title+'&interval_timer='+both;
    }
</script>